<template>
	<!--
    	作者：1550495493@qq.com
    	时间：2019-07-18
    	描述：动态编写
    -->
	<div class="HomePage">
		<div class="location">
			<div class="location-text fl">
				<img class="location-img fl" src="../../images/PortalThemes/addNews.png" />
				<p class="fr">{{wrkDynamic.id == null || wrkDynamic.id == "" ? "动态发布" : "动态修改"}}</p>
			</div>
			<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
		</div>
		<div class="IssuedNotice-box">
			<form id="newsReleaseForm" class="form-box">
				<input type="hidden" name="id" :value="wrkDynamic.id" />
				<input type="hidden" name="type" value="1" />

				<div class="search-boxs form-line input-required">
					<label>标题：</label>
					<div class="input-box">
						<input name="name" class="search-box" type="text" v-model="wrkDynamic.name" />
					</div>
				</div>
				<div class="search-boxs form-line input-required editor-box">
					<label class="editor-lable">正文：</label>
					<div class="input-box">
            <!--<label id="editor-error" class="error" for="editor">请输入正文！</label>-->
            <textarea name="content" class="editor" id="editor" style="width: 700px;height: 270px;display: inline-block;"></textarea>
            <!--<script name="content" class="editor" id="editor" type="text/plain" style="width: 700px;height: 270px; display: inline-block; "/>-->
					</div>
				</div>
				<div class="search-boxs  imgbox">
					<label>展示图：</label>
					<div class="imgbtn">
						<input type="file" id="handIdFront" accept="image/*" @change="idFrontImg($event)" style="display: none;" />
						<img class="showHandIdFront" :src="wrkDynamic.coverUrl != null ? urls.baseUrl + wrkDynamic.coverUrl : defaultUrl" />
						<a class="Public-btn1 uploadbtn again-upload " @click="touchOffIdInput(1)">重新上传</a>
						<a class="Public-btn1 uploadbtn handIdFrontA " @click="touchOffIdInput(1)">上传</a>
						<input type="hidden"  name="coverUrl" :value="wrkDynamic.coverUrl" />

					</div>
				</div>
        <div class="search-boxs">
          <label class="enclosure">附件：</label>
          <input type="file" id="handIdFront2" accept=".txt,.rar,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.exe,image/*" @change="idFrontImg2($event)" style="display: none;" />
          <input type="button" value="上传附件" class="delete write" @click="touchOffIdInput(2)"/>
          <input type="button" value="删除附件" class="delete write" @click="deleteEnclosure()"/>
          <ul class="img-box">
            <li id="enclosure"></li>
          </ul>
          <input type="hidden" name="enclosureUrl" :value="wrkDynamic.enclosureUrl" />
        </div>
				<input class="save fl" type="button" value="发布" @click="saveData" v-if="wrkDynamic.id == null" />
				<input class="save fl" type="button" value="保存" @click="updateData" v-else/>
			</form>
			<label id="coverUrl" v-if="!wrkDynamic.coverUrl&&showMsg">请选择展示图片</label>
		</div>
	</div>
</template>

<script src="./ByTheNews.js"></script>

<style scoped>
	@import "ByTheNews.css"
</style>
